<div id="information">
<br /><br />
<?php
$select_m = mysql_query('SELECT * FROM news');

if(mysql_num_rows($select_m)==0){
   echo '<p>Няма новини към този самоучител!</p>';
} else {

if($_GET['mode']=="edit"){
$select_module = mysql_query('SELECT * FROM news WHERE news_id='.$_GET['id'].'');
$row_module = mysql_fetch_assoc($select_module);
?>
<form method="post" action="<?php echo 'editnews.php?id='.$_GET['id'].'&mode=edit'; ?>" class="form">
   <h3 class="form_h3">Име на новината</h3>
   <input type="text" name="news_name" value="<?php echo $row_module['news_name']; ?>" />
   <h3 class="form_h3">Описание на новината</h3>
   <textarea cols="50" rows="5" name="news_descr"><?php echo $row_module['news_descr']; ?></textarea>
   <h3 class="form_h3">Новина</h3>
   <textarea cols="50" rows="5" name="content"><?php echo $row_module['content']; ?></textarea><br /><br />
   <input type="submit" name="submit_news" value="Редактирай новината" />
</form>
<?php
include "../php/editnews.php";
} else if($_GET['mode']=="delete"){
   $delete_poll=mysql_query('DELETE FROM news WHERE news_id='.$_GET['id'].'');
   echo '<meta http-equiv="refresh" content="0; url=editnews.php">';
} else {
   echo '
	<table border="0" style="border-collapse: collapse; margin-left: 20px; width: 650px; text-shadow: 1px 1px 1px #fff;">
	<tr style="background-color: #b7b6b6;"><td align="center"><p><b>Име на новината</b></p></td><td align="center"><p><b>Опции</b></p></td></tr>
	';
while($row_m = mysql_fetch_assoc($select_m)){
   	echo '<tr><td></td></tr>';
	echo '<tr><td></td></tr>';
	echo '<tr><td></td></tr>';
    echo '<tr style="height: 40px; background-color: #ede7e7; text-shadow: 3px 3px 3px #fff;"><td style="padding-left: 10px;"><b>'.$row_m['news_name'].'</b></td>
	<td style="padding-right: 10px; text-align: center;">
	<a href="editnews.php?id='.$row_m['news_id'].'&amp;mode=edit"><img src="../img/see.png" alt="see"/></a>
	<a href="editnews.php?id='.$row_m['news_id'].'&amp;mode=delete"><img src="../img/delete.png" alt="delete"/></a></td></tr>
	<tr><td colspan="4" style="padding-left: 10px; padding-right: 10px;"><hr /></td></tr>';
}
echo '</table>';
}
}
?>
</div>